<div class="problemindexholder" problemindex="B">
 <div class="ttypography">
  <div class="problem-statement">
   <div class="header">
    <div class="title">
     B. Vlad and Cafes
    </div>
    <div class="time-limit">
     <div class="property-title">
      time limit per test
     </div>
     2 seconds
    </div>
    <div class="memory-limit">
     <div class="property-title">
      memory limit per test
     </div>
     256 megabytes
    </div>
    <div class="input-file">
     <div class="property-title">
      input
     </div>
     standard input
    </div>
    <div class="output-file">
     <div class="property-title">
      output
     </div>
     standard output
    </div>
   </div>
   <div>
    <p>
     Vlad likes to eat in cafes very much. During his life, he has visited cafes
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     times. Unfortunately, Vlad started to feel that his last visits are not any different from each other. To fix that Vlad had a small research.
    </p>
    <p>
     First of all, Vlad assigned individual indices to all cafes. Then, he wrote down indices of cafes he visited in a row, in order of visiting them. Now, Vlad wants to find such a cafe that his last visit to that cafe was before his last visits to every other cafe. In other words, he wants to find such a cafe that he hasn't been there for as long as possible. Help Vlad to find that cafe.
    </p>
   </div>
   <div class="input-specification">
    <div class="section-title">
     Input
    </div>
    <p>
     In first line there is one integer
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       n
      </i>
      ≤ 2·10
      <sup class="upper-index">
       5
      </sup>
     </span>
     ) — number of cafes indices written by Vlad.
    </p>
    <p>
     In second line,
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     numbers
     <span class="tex-span">
      <i>
       a
      </i>
      <sub class="lower-index">
       1
      </sub>
      ,
      <i>
       a
      </i>
      <sub class="lower-index">
       2
      </sub>
      , ...,
      <i>
       a
      </i>
      <sub class="lower-index">
       <i>
        n
       </i>
      </sub>
     </span>
     (
     <span class="tex-span">
      0 ≤
      <i>
       a
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
      ≤ 2·10
      <sup class="upper-index">
       5
      </sup>
     </span>
     ) are written — indices of cafes in order of being visited by Vlad. Vlad could visit some cafes more than once. Note that in numeration, some indices could be omitted.
    </p>
   </div>
   <div class="output-specification">
    <div class="section-title">
     Output
    </div>
    <p>
     Print one integer — index of the cafe that Vlad hasn't visited for as long as possible.
    </p>
   </div>
   <div class="sample-tests">
    <div class="section-title">
     Examples
    </div>
    <div class="sample-test">
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>5<br/>1 3 2 1 2<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>3<br/></pre>
     </div>
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>6<br/>2 1 2 2 4 1<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>2<br/></pre>
     </div>
    </div>
   </div>
   <div class="note">
    <div class="section-title">
     Note
    </div>
    <p>
     In first test, there are three cafes, and the last visits to cafes with indices
     <span class="tex-span">
      1
     </span>
     and
     <span class="tex-span">
      2
     </span>
     were after the last visit to cafe with index
     <span class="tex-span">
      3
     </span>
     ; so this cafe is the answer.
    </p>
    <p>
     In second test case, there are also three cafes, but with indices
     <span class="tex-span">
      1
     </span>
     ,
     <span class="tex-span">
      2
     </span>
     and
     <span class="tex-span">
      4
     </span>
     . Cafes with indices
     <span class="tex-span">
      1
     </span>
     and
     <span class="tex-span">
      4
     </span>
     were visited after the last visit of cafe with index
     <span class="tex-span">
      2
     </span>
     , so the answer is
     <span class="tex-span">
      2
     </span>
     . Note that Vlad could omit some numbers while numerating the cafes.
    </p>
   </div>
  </div>
  <p>
  </p>
 </div>
</div>
